<%-- 
    Document   : dialog_component_properties
    Created on : 14.03.2014, 12:26:24
    Author     : Corvus 11
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="core" uri="http://java.sun.com/jsp/jstl/core" %>

<div id="component_properties_main">
    <form:form id="componentForm" commandName="componentCommandForm">
        <form:hidden path="id"/>
        <form:hidden id="cp_validation_error" path="validationError"/>
        <table class="table no-border">
            <core:choose>
                <core:when test="${componentCommandForm.validationError == false}">
                    <col width="170">
                    <col>
                    <col width="0">
                </core:when>
                <core:otherwise>
                    <col width="170">
                    <col>
                    <col width="200">
                </core:otherwise>
            </core:choose>
            <tr>
                <td>Название: </td>
                <td class="input-control text" data-role="input-control">
                    <form:input style="height: auto" path="description" />
                </td>
                <td><form:errors path="description"/></td>
            </tr>
            <tr>
                <td>Серийный номер: </td>
                <td class="input-control text" data-role="input-control">
                    <form:input style="height: auto" path="serial"/>
                </td>
                <td><form:errors path="serial"/></td>
            </tr>
            <tr>
                <td>Тип: </td>
                <td colspan="2">${componentCommandForm.typeName}</td>
            </tr>
            <tr>
                <td>Дата покупки: </td>
                <td>
                        <div class="input-control text" data-role="datepicker" data-locale='ru'>
                            <form:input path="buyDateString"/>
                            <button type="button" class="btn-date"></button>
                        </div>
                </td>
                <td><form:errors path="buyDateString"/></td>
            </tr>
            <tr>
                <td>Гарантия до: </td>
                <td>
                    <div class="input-control text" data-role="datepicker" data-locale='ru'>
                        <form:input path="warrantyEndDateString"/>
                        <button type="button" class="btn-date"></button>
                    </div>
                </td>
                <td><form:errors path="warrantyEndDateString"/></td>
            </tr>
                <tr>
                    <td colspan="3">
                        <input class="place-right place-bottom" id="dialog_cp_submit" name="dialog_cp_submit" value="Применить" type="button" onclick="submitComponentData();">
                    </td>
                </tr>
        </table>
    </form:form>
</div>